package com.sky1324.myspringboot.mapper;

import com.sky1324.myspringboot.entity.sysUser;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
// 给springboot 管理
public interface sysUserMapper {
    // 定义Mapper方法

    @Select("SELECT * FROM sys_user")
//   查询所有数据
   List<sysUser> findAll();
      @Insert("INSERT INTO sys_user (username, password, nickname, email, phone, address) VALUES (#{username}, #{password}, #{nickname}, #{email}, #{phone}, #{address})")
    int insert(sysUser sysUser);
    void updateA(sysUser sysUser);

//    @Param("id")  id要与 #{id} 对应
    @Delete("DELETE FROM sys_user WHERE id = #{id}")
    Integer deleteByid(@Param("id") Integer id);





//    @Select("SELECT * from sys_user LIMIT #{pageNum}, #{pageSize}")
//    Param 接受的参数  否则参数为空 报错
    List<sysUser> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize,@Param("username") String username);





    Integer selecatTotal(@Param("username") String username);
}
